﻿using System;
using System.Windows.Forms;
using DevComponents.DotNetBar;
namespace QLTVNEW
{
    class clsCall
    {
        public ButtonX btnclear { get; set; }

        public ButtonX btndel{ get; set; }

        public ButtonX btnupdate { get; set; }

        public ButtonX btnsave { get; set; }

        public ButtonX btninsert { get; set; }

        public ButtonX btnlast { get; set; }

        public ButtonX btnfirst { get; set; }

        public ButtonX btnnext { get; set; }

        public ButtonX btnpre { get; set; }

        public GroupBox group1 { get; set; }

        public void Clear(int i)
        {
            if (i == 0)
            {
                foreach (Control ctr in group1.Controls)
                {
                    if (ctr is TextBox)
                    {
                        ctr.Text = "";
                    }
                }
            }
            else
            {
                foreach (Control ctr in group1.Controls)
                {
                    if (ctr is TextBox || ctr is MaskedTextBox)
                    {
                        ctr.Text = "";
                    }
                }
            }
        }

        public void btnThem(bool a)
        {
            btnupdate.Enabled = a;
            btndel.Enabled = a;
        }

        public void btnSua(bool a)
        {
            btninsert.Enabled = a;
            btndel.Enabled = a;
        }

        public void MoveDau(bool a)
        {
            btnfirst.Enabled = a;
            btnpre.Enabled = a;
        }

        public void MoveCuoi(bool a)
        {
            btnlast.Enabled = a;
            btnnext.Enabled = a;
        }

       
    }
}
